<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Recent extends MX_Controller {


	function __construct()
	{
		parent::__construct();
		$this->load->model('listing/listing_model');
		$this->load->model('location/location_model');
		$this->load->model('category/category_model');
	}

	public function showListing($cityID=0, $limit=5){
		
		
		if($cityID !=0){
			$sql = "select * from profile where city=$cityID and status=51 ORDER BY (id) DESC LIMIT 0, $limit" ;
		}
		else{
			$sql = "select * from profile where status=51 ORDER BY (id) DESC LIMIT 0, $limit" ;
		}
		//die($sql);
		$result = $this->db->query($sql)->result();
		if(!$result){
			$result = NULL;
		}
		$data['recent_listing'] = $result;
		
		$data['Page'] ='PARTIAL';
		$this->load->view('recent_listing',$data);
	}



}